package com.github.kezhenxu94.acs;

import java.util.Arrays;

import com.github.kezhenxu94.acs.common.Model;

/**
 * Created by kezhenxu on Dec 19, 2016
 *
 * @author kezhenxu (kezhenxu94@163.com)
 */
public class Solution implements Model {
	protected int[] solution;

	public Solution(int size) {
		this.solution = new int[size];
	}

	public Solution(int[] solution) {
		this.solution = solution;
	}

	public int[] getSolution() {
		return solution;
	}

	public void setSolution(int[] solution) {
		this.solution = solution;
	}

	public void assignCluster(int index, int cluster) {
		solution[index] = cluster;
	}

	public int getSolution(int i) {
		return solution[i];
	}

	@Override
	public String toString() {
		return Arrays.toString(solution);
	}

}
